package com.taoyige.bean;

import java.io.InputStream;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.taoyige.common.JacksonJsonUtil;

/**
 * 微信用户信息类：OAuth认证返回的数据集
 * @author peter
 * @version 1.0
 * @created 2014-11-12
 */
@JsonIgnoreProperties(ignoreUnknown=true)
public class WXUserInfo 
{
	
    public static final String WX_USERINFO_OPENID           = "openid";
    public static final String WX_USERINFO_NICKNAME  = "nickname";
    public static final String WX_USERINFO_SEX    = "sex";
    public static final String WX_USERINFO_HEAD_IMG_URL    = "headimgurl";
    
	private String openid;
	private String nickname;
	private Long sex;
	private String headimgurl;
	
	
	public String getOpenid() {
		return openid;
	}


	public void setOpenid(String openid) {
		this.openid = openid;
	}


	public String getNickname() {
		return nickname;
	}


	public void setNickname(String nickname) {
		this.nickname = nickname;
	}


	public Long getSex() {
		return sex;
	}


	public void setSex(Long sex) {
		this.sex = sex;
	}


	public String getHeadimgurl() {
		return headimgurl;
	}


	public void setHeadimgurl(String headimgurl) {
		this.headimgurl = headimgurl;
	}


	public static WXUserInfo  parse(InputStream ins) throws Exception {
		WXUserInfo wx = (WXUserInfo) JacksonJsonUtil.jsonToBean(ins, WXUserInfo.class);
		return wx;
	}
	
	
}